﻿<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <title></title>

    <!--JQuery UI-->
    <link rel="stylesheet" href="lib/jquery-ui.css" />
    <!--标签式输入框-->
    <link rel="stylesheet" href="lib/jquery.tagsinput.css" />
    <!--日期选择-->
    <link rel="stylesheet" href="lib/datepicker3.css" >
    <!--bootstrap-->
    <link rel="stylesheet" href="lib/bootstrap.min.css" >
    <!--font-awesome图标字体库-->
    <link rel="stylesheet" href="lib/font-awesome.css">
    <!--基础风格-->
    <link rel="stylesheet" href="lib/style.css" >
    <!--icheck-->
    <link rel="stylesheet" href="lib/custom.css" >
    <!--switchery-->
    <link rel="stylesheet" href="lib/switchery.css">
    <!--touchspin-->
    <link rel="stylesheet" href="lib/jquery.bootstrap-touchspin.min.css" >
    <!--Sweet Alert-->
    <link rel="stylesheet" href="lib/sweetalert.css" >

    <!--JQuery-->
    <script src="lib/jquery-2.1.1.js"></script>
    <!--JQuery UI-->
    <script src='lib/jquery-ui.custom.min.js'></script>
    <!--标签式输入框-->
    <script src="lib/jquery.tagsinput.js"></script>
    <!--switchery-->
    <script src="lib/switchery.js"></script>
    <!--icheck-->
    <script src="lib/icheck.min.js"></script>
    <!-- TouchSpin -->
    <script src="lib/jquery.bootstrap-touchspin.min.js"></script>
    <!--bootstrap-->
    <script src="lib/bootstrap.min.js"></script>
    <!-- Sweet alert -->
    <script src="lib/sweetalert.min.js"></script>
    <!-- Data picker -->
    <script src="lib/bootstrap-datepicker.js"></script>
    <!-- Flot -->
    <script src="lib/jquery.flot.js"></script>
    <script src="lib/jquery.flot.tooltip.min.js"></script>
    <script src="lib/jquery.flot.resize.js"></script>
    <script src="lib/jquery.flot.pie.js"></script>
    <!-- Flot demo data -->
    <script src="lib/flot-demo.js"></script>

    
    <!-- Toastr style -->
    <link href="lib/toastr.min.css" rel="stylesheet">
    <!-- Toastr script -->
    <script src="lib/toastr.min.js"></script>
    
</head>

<body onload="createCode();">
    <script>

        //令牌功能
        function cache_token(){
            
            //当前时间
            var time_now = new Date().getTime().toString();

            var cache_token = get_cache_token();
            
            if( cache_token == null ){
                //没有令牌

                if( window.location.href.indexOf("?") != -1 ){
                    window.location.href=window.location.href + "&cache_token="+time_now;
                }else{
                    window.location.href=window.location.href + "?cache_token="+time_now;
                }

            }else{
                //有令牌

                //当前时间
                var new_time = new Date().getTime().toString();

                //更新令牌
                if(( new_time - cache_token) > 1000){
                    
                    var new_url;
                    //新令牌
                    new_url  = window.location.href.replace(cache_token,new_time);

                    //重定向
                    window.location.href = new_url;
                }
            }

        }

        //获取令牌
        function get_cache_token(){
            var reg = new RegExp("(^|&)"+ "cache_token" +"=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);

            if(r!=null)
                return  unescape(r[2]); 

            return null;
        }
        

    </script>
    <div id="wrapper">
        <div class="ibox float-e-margins">

            <div class="ibox-title">
                <h5><i class="fa fa-shield"></i> <span id="p_title"></span></h5>
                <div class="ibox-tools">

                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        <i class="fa fa-question-circle"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-user">
                        <li><a target="_blank" href="" id="oem_homepage_url"><span id="oem_homepage"></span></a></li>
                        
                    </ul>
                </div>
                
            </div>

            <div class="ibox-content">
                <div class="panel-body">
                    <div class="tabs-container">

                        <!--Tab标题-->
                        <ul class="nav nav-tabs">
                            <li class="active"><a data-toggle="tab" href="#tab-1">帐号登录</a></li>
                            <li class=""><a data-toggle="tab" href="#tab-2">参数配置</a></li>
                            <li class=""><a data-toggle="tab" href="#tab-3" onclick="refresh_data();">数据统计</a></li>
                            <li class=""><a data-toggle="tab" href="#tab-4">态势感知</a></li>
                        </ul>
                        <script>
                            function refresh_data(){
                                //如果未登录，返回
                                if(document.getElementById("div_query_login_tip").style.display != "none") {
                                    return;
                                }
                                
                                console.log("refresh data");
                                //刷新数据
                                query_all();
                                get_zxt();
                                get_bxt();
                                get_zzt();
                                origens_query(0,'','');
                            }
                        </script>
                        <!--Tab内容-->
                        <div class="tab-content">
                            <div id="tab-1" class="tab-pane active">
                                <div class="panel-body">
                                    
                                    <div class="row" id="div_login">
                                        <div class="col-sm-6 b-r">
                                        
                                            <h3 class="m-t-none m-b">登录</h3>
                                            <div class="form-group"><label>帐号</label> <input id="login_username" type="text" placeholder="请输入帐号" class="form-control"></div>
                                            <div class="form-group"><label>密码</label> <input id="login_password" type="password" placeholder="请输入密码" class="form-control"></div>
                                            <label>验证码</label>
                                            <div id="verify_login" style="width: 200px;height: 50px;"></div>
                                            <input type="text" id="code_login_input" value="" placeholder="请输入验证码" class="form-control" style="width: 200px;"/><br>
                                            <div>
                                                <button class="btn btn-sm btn-primary m-t-n-xs" type="submit" onclick="verify_login();"><strong>登录</strong></button>
                                            </div>
                                            
                                        </div>
                                        <div class="col-sm-6"><h4>没有账号？</h4>
                                            <p>30秒创建账号：</p>
                                            <p class="text-center">
                                                <a href="" data-toggle="modal" data-target="#myModal1" >
                                                    <i class="fa fa-user big-icon"></i><br>
                                                    <button class="btn btn-sm btn-info m-t-n-xs"><strong>注册帐号</strong></button>
                                                </a>
                                            </p>
                                            <div class="modal inmodal" id="myModal1" tabindex="-1" role="dialog"  aria-hidden="true">
                                                <div class="modal-dialog">

                                                    <div class="modal-content ">
                                                        <div class="modal-header">
                                                            <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                                                            <i class="fa fa-clock-o modal-icon"></i>
                                                            <h4 class="modal-title">注册帐号</h4>
                                                            <small>注册后可立刻保护您的网站</small><br>
                                                            <span class="badge badge-danger">重要提示</span>下面注册时，帐号填域名，不带http(s)://；保护目标填IP，带http(S)://。
                                                        </div>
                                                        <div class="ibox-content">
                                                            
                                                            <div class="row">
                                                                <div class="col-lg-8">
                                                                    <div class="form-group">
                                                                        <label>帐号 *</label>
                                                                        <input id="register_username" type="text" placeholder="请使用要保护的域名做为帐号，例：www.baidu.com" class="form-control required">
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label>保护目标 *</label>
                                                                        <input id="register_target" type="text" placeholder="被保护网站IP，可带端口，例：http://127.0.0.1:8080" class="form-control required">
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label>密码 *</label>
                                                                        <input id="register_password" type="password" class="form-control required">
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label>确认密码 *</label>
                                                                        <input id="register_confirm" type="password" class="form-control required">
                                                                    </div>
                                                                    <label>验证码</label>
                                                                    <div id="verify_register" style="width: 200px;height: 50px;"></div>
                                                                    <input type="text" id="code_register_input" value="" placeholder="请输入验证码" class="form-control" style="width: 200px;"/><br>
                                                                </div>
                                                                <div class="col-lg-4">
                                                                    <div class="text-center">
                                                                        <div style="margin-top: 20px">
                                                                            <i class="fa fa-sign-in" style="font-size: 180px;color: #e5e5e5 "></i>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </div>
                        
                                                            <button type="button" class="btn btn-primary" onclick="register();"><i class="fa fa-user"></i> 确认注册</button>
                                                            
                                                        </div>
                                                        
                                                        <div class="modal-footer">
                                                            <button type="button" class="btn btn-white" data-dismiss="modal" id="close_modal">关闭</button>
                                                        </div>
                                                    </div>

                                                </div>
                                            </div>

                                        </div>
                                    </div>
                                    <div id="div_login_out" style="display: none">
                                        <button class="btn btn-sm btn-primary" onclick="exit();" ><i class="fa fa-refresh"></i> 退出登录</button>
                                        <script>
                                            function exit() {
                                                /*
                                                swal({
                                                    title: "提示！",
                                                    text: "已退出登录。"
                                                });
                                                */
                                                document.getElementById("div_login").style.display="block";
                                                document.getElementById("div_login_out").style.display="none";

                                                document.getElementById("div_config").style.display="none";
                                                document.getElementById("div_config_login_tip").style.display="block";
                                                
                                                document.getElementById("div_query").style.display="none";
                                                document.getElementById("div_query_login_tip").style.display="block";

                                                document.getElementById("div_sa").style.display="none";
                                                document.getElementById("div_sa_login_tip").style.display="block";

                                                window.location.reload();
                                            }
                                        </script>
                                    </div>
                                </div>
                            </div>
                            <div id="tab-2" class="tab-pane">
                                <div class="panel-body">
                                    <div id="div_config" style="display:none">
                                        <button class="btn btn-sm btn-primary" onclick="read_config();"><i class="fa fa-refresh"></i> 刷新</button><br>
                                        <br>
                                        <div style="height:100%;">
                                        <div style="display:none;">
                                            <span class="badge badge-danger">通用功能（不可更改）</span>
                                            
                                            <ul>
                                                <br>
                                                <li class="altr-color">
                                                    Shield端口：<br>
                                                    说明：提供保护服务的内部端口。例：http://127.0.0.1:1000/<br>
                                                    <div style="width:120px;">
                                                        <input type="textbox" class="touchspin1" id="shield_port" disabled="disabled"/><br>
                                                    </div>
                                                </li>
                                                <br>
                                                <li class="altr-color">
                                                    Router端口/WEB服务端口（HTTP访问端口）：<br>
                                                    说明：提供http访问域名的端口（推荐使用80）。例：http://127.0.0.1/<br>
                                                    <div style="width:120px;">
                                                        <input type="textbox" class="touchspin1" id="router_port" disabled="disabled"/><br>
                                                    </div>
                                                </li>
                                                <br>
                                                <li class="altr-color">						
                                                    控制中心端口：<br>
                                                    说明：可通过此端口访问管理后台。例：http://127.0.0.1:8080/<br>
                                                    特别提示：如果更改此端口，更新配置后本页面地址将失效，需要重新在URL中输入正确的端口号。<br>
                                                    <div style="width:120px;">
                                                        <input type="textbox" class="touchspin1" id="sa_port" disabled="disabled"/><br>
                                                    </div>
                                                </li>
                                                <br>
                                                <li class="altr-color">    
                                                    <input type="checkbox" id="ssl_on" disabled="disabled"/>SSL（https访问）<br>
                                                    说明：是否启用SSL服务。
                                                    <br>
                                                    https访问端口（推荐使用443端口）：<br>
                                                    <div style="width:120px;">
                                                        <input type="textbox" class="touchspin1" id="ssl_port" disabled="disabled"/><br>
                                                    </div>
                                                </li>
                                                <br>
                                                <li class="altr-color" style="display: none">    
                                                    <div class="input-group m-b">
                                                        <span class="input-group-btn">
                                                            <button type="button" class="btn btn-primary"><i class="fa fa-globe"></i></button>
                                                        </span> 
                                                        <input class="form-control" id="skip_to" type="text" style="width:300px;" disabled="disabled">
                                                    </div>
                                                    <br>
                                                </li>
                                                
                                                <li class="altr-color">
                                                    <input type="checkbox" id="cluster_enable" disabled="disabled"/>集群功能<br>
                                                    说明：启用集群功能后，将会有N（N=机器核数）个保护服务，会提升产品稳定性。<br>
                                                </li>
                                                <br>
                                                <li class="altr-color">
                                                    <input type="checkbox" id="debug" disabled="disabled"/>调试模式<br>
                                                    说明：开启时，会在后台命令行输出各种调试信息。通常用于部署初期，调试各种功能时用。<br>
                                                </li>
                                                <br>
                                            </ul>

                                            <span class="badge badge-danger">记录（不可更改）</span>
                                            
                                            <ul>
                                                <li class="altr-color">
                                                    <input type="checkbox" id="use_sqlite3" disabled="disabled"/>访问和攻击记录保护到数据库<br>
                                                    如选择此项，则记录保存到数据库。如不选择，记录将保护在log目录下的日志文件中，此时不可通过后台查询各种访问、攻击记录，但态势感知功能仍可实时显示信息。<br>								
                                                    <br>
                                                </li>
                                            </ul>
                                            <br>
                                        </div>
                                            <span class="badge badge-info">保护目标</span>
                                            <ul>
                                                <br>
                                                <li class="altr-color">
                                                    <div>
                                                        保护域名：<br>
                                                        说明：您的域名地址，格式如：www.baidu.com，也用做登录时的帐号名。<br>
                                                        <div class="input-group m-b">
                                                            <span class="input-group-btn">
                                                                <button type="button" class="btn btn-primary"><i class="fa fa-shield"></i></button>
                                                            </span> 
                                                            <input class="form-control" id="shield_address_0" type="text" style="width:300px;" disabled="disabled">
                                                        </div>
                                                    </div>
                                                    <div>
                                                        Web地址：<br>
                                                        说明：网站真正的地址，访问上面的被保护域名时，将从这里获取数据。<br>
                                                        <div class="input-group m-b">
                                                            <span class="input-group-btn">
                                                                <button type="button" class="btn btn-primary"><i class="fa fa-globe"></i></button>
                                                            </span> 
                                                            <input class="form-control" id="shield_address_1" type="text" style="width:300px;" disabled="disabled">
                                                        </div>
                                                    </div>
                                                    <div>
                                                        <iframe name="upload_iframe" id="upload_iframe" style="display: none;"></iframe>
                                                        <script>
                                                            //显示文件上传返回结果
                                                            document.getElementById("upload_iframe").onload = function(){
                                                                var upload_return = document.getElementById("upload_iframe").contentWindow.document.body.innerText;
                                                                if(upload_return != ""){
                                                                    alert(upload_return);
                                                                }
                                                            }
                                                        </script>
                                                        Key文件：<br>
                                                        当启用SSL功能时，需提在此提供对应的证书文件。文件名需要为：“域名.key”<br>
                                                        <div class="input-group m-b">
                                                            <span class="input-group-btn">
                                                                <button type="button" class="btn btn-primary"><i class="fa fa-file-text"></i></button>
                                                            </span> 
                                                            <input class="form-control" id="shield_address_2" type="text" style="width:300px;height:34px;">
                                                            &nbsp;&nbsp;
                                                            <button class="btn btn-info" onclick="display_form_upload_key();" style="height:34px;"><i class='fa fa-caret-down' id="i_upload_key"></i></button>
                                                        </div>
                                                        <script>
                                                            function display_form_upload_key(){
                                                                var display_state = document.getElementById('form_upload_key').style.display;
                                                                
                                                                if(display_state=="block"){
                                                                    document.getElementById('form_upload_key').style.display ="none";
                                                                    document.getElementById('i_upload_key').className='fa fa-caret-down';
                                                                }else{
                                                                    document.getElementById('form_upload_key').style.display ="block";
                                                                    document.getElementById('i_upload_key').className='fa fa-caret-up';
                                                                }
                                                            }
                                                        </script>
                                                        <form action='/upload' enctype='multipart/form-data' method='post' target='upload_iframe' id="form_upload_key" style="display: none">
                                                            <input type='hidden' name='username' id='key_username'>
                                                            <input type='hidden' name='password' id='key_password'>
                                                            <input type='file' name='upload' multiple='multiple' accept='.key'>
                                                            <input type='submit' value='上传' onclick="document.getElementById('shield_address_2').value = document.getElementById('key_username').value + '.key';">
                                                            <br><br>
                                                        </form>
                                                        <!--
                                                        另一种上传方法
                                                        <span class="label label-danger" id="key_span" style="display:none;width:100%;max-width: 200px;">
                                                            上传成功了吗？
                                                            <button type="button" class="btn btn-circle btn-success" onclick="document.getElementById('shield_address_2').value=document.getElementById('login_username').value+'.key';document.getElementById('key_span').style.display='none';">YES</button>
                                                            <button type="button" class="btn btn-circle btn-warning" onclick="document.getElementById('shield_address_2').value='';document.getElementById('key_span').style.display='none';">NO</button>
                                                        </span>
                                                        -->
                                                        <script>
                                                            /*
                                                            另一种上传方法
                                                            function upload_key(){
                                                                document.getElementById("key_span").style.display="block";
                                                                var open_window=window.open("", "upload_key", "height=250,width=250,toolbar=no,scrollbars=no,resizable=no,location=no,menubar=no");
                                                                open_window.document.body.innerHTML="";
                                                                open_window.document.write("<h2>上传文件</h2>");
                                                                open_window.document.write("<form action='"+ sa_origins_host +"/upload' enctype='multipart/form-data' method='post'>");
                                                                //下面两个input中，需要使用name而不是id，因为后端处理时id接收不到
                                                                open_window.document.write("<input type='hidden' name='username' value='"+this.document.getElementById("login_username").value + "'>");
                                                                open_window.document.write("<input type='hidden' name='password' value='"+this.document.getElementById("login_password").value + "'>");
                                                                open_window.document.write("<input type='file' name='upload' multiple='multiple' accept='.key'>");
                                                                open_window.document.write("<input type='submit' value='上传'>");
                                                                open_window.document.write("</form>");
                                                            }
                                                            */
                                                        </script>
                                                        
                                                    </div>
                                                    <div>
                                                        Pem文件：<br>
                                                        当启用SSL功能时，需提在此提供对应的证书文件。文件名需要为：“域名.pem”<br>
                                                        <div class="input-group m-b">
                                                            <span class="input-group-btn">
                                                                <button type="button" class="btn btn-primary"><i class="fa fa-file-text"></i></button>
                                                            </span>
                                                            <input class="form-control" id="shield_address_3" type="text" style="width:300px;height:34px;">
                                                            &nbsp;&nbsp;
                                                            <button class="btn btn-info" onclick="display_form_upload_pem();" style="height:34px;"><i class='fa fa-caret-down' id="i_upload_pem"></i></button>
                                                        </div>
                                                        <form action='/upload' enctype='multipart/form-data' method='post' target='upload_iframe' id="form_upload_pem" style="display: none">
                                                            <input type='hidden' name='username' id='pem_username'>
                                                            <input type='hidden' name='password' id='pem_password'>
                                                            <input type='file' name='upload' multiple='multiple' accept='.pem'>
                                                            <input type='submit' value='上传' onclick="document.getElementById('shield_address_3').value = document.getElementById('pem_username').value + '.pem';">
                                                        </form>
                                                        <script>
                                                            function display_form_upload_pem(){
                                                                var display_state = document.getElementById('form_upload_pem').style.display;
                                                                
                                                                if(display_state=="block"){
                                                                    document.getElementById('form_upload_pem').style.display ="none";
                                                                    document.getElementById('i_upload_pem').className='fa fa-caret-down';
                                                                }else{
                                                                    document.getElementById('form_upload_pem').style.display ="block";
                                                                    document.getElementById('i_upload_pem').className='fa fa-caret-up';
                                                                }
                                                            }
                                                        </script>
                                                    </div>

                                                </li>
                                            </ul>
                                            
                                            <span class="badge badge-info">页面编码</span>
                                            <br>
                                            <ul>
                                                <li class="altr-color">
                                                    自定义页面骗码，常见类型：utf8、gb2312、ascii、binary、base64、hex<br>
                                                    <input class="tag" type="textbox" id="page_coding" style="width:100%;max-width: 500px;" /><br>
                                                </li>
                                            </ul>
                                            <br>

                                            <span class="badge badge-info">功能设定</span>
                                            <ul>
                                                <br>
                                                <li class="altr-color">
                                                    <input type="checkbox" id="js_protect_enable"/> JS保护<br>
                                                    说明：保护JS文件和网页中的JS代码。<br>
                                                    <br>
                                                    排除清单：<br>
                                                    说明：1、列入排除清单的JS文件，JS保护功能将不对其进行保护；2、最多256个文件名。<br>
                                                    注意：请使用全小写字母。<br>
                                                    <input class='tags' type="textbox" id="js_unprotect" /><br>
                                                </li>
                                                <br>
                                                <li class="altr-color">
                                                    <input type="checkbox" id="transform_element_enable" />变形元素<br>
                                                    说明：保护网页中易受到攻击的关键元素，如用户名、手机号、Email等字段。<br>
                                                    <br>
                                                    <div class="alert alert-info" style="width: max-content;">
                                                        <input type="checkbox" id="auto_transform" />自动变形元素<br>启用时，自动保护Form提交内容。与下面手动设置变形元素的差异之处，详见产品说明书。
                                                    </div>
                                                    <br>
                                                    变形元素清单：<br>
                                                    说明：1、输入要进行变形保护的元素（元素的ID和Name属性）；2、最多256个元素名。<br>
                                                    注意：不可使用password等html或js语言关键字、区分字母大小写、区分全角半角。<br>
                                                    <input class='tags' type="textbox" id="transform_element"/><br>
                                                    <br>
                                                    <div>
                                                        <!--暂不使用一次性变形元素，因为一次性变形元素容易引起问题，比如：getelementbyid("test")，而test在html中设定成了变形元素，则会引起js中与页面中变形后的名称不一至-->
                                                        变形类型：<br>
                                                        <br>
                                                        <input type="radio" id="transform_element_type" name="transform_element_type" checked="0" />一次性变形<br>
                                                        说明：元素一次性有效。<br>
                                                        <br>
                                                        一次性变形有效期（单位：分钟）：<br>
                                                        <div style="width:120px">
                                                            <input class="touchspin1" type="textbox" id="transform_element_once_at" style="width:100px;" /><br>
                                                        </div>
                                                        <br>
                                                    </div>
                                                    <input type="radio" id="transform_element_type" name="transform_element_type" checked="1" />时间变形<br>
                                                    说明：元素在一定时间内有效。<br>
                                                    <br>
                                                    时间变形周期（单位：分钟）：<br>
                                                    <div style="width: 120px">
                                                        <input class="touchspin1" type="textbox" id="transform_element_cyc" style="width:100px;" /><br>
                                                    </div>
                                                </li>
                                                <br>
                                                <li class="altr-color">
                                                    <input type="checkbox" id="dynamic_token_enable" />动态令牌<br>
                                                    说明：保护关键URL页面。<br>
                                                    <br>
                                                    <div class="alert alert-info" style="width: max-content;">
                                                        <input type="checkbox" id="auto_dynamic_token" />自动动态令牌<br>启用时，自动给所有页面增加令牌。与下面手动设置令牌的差异之处，详见产品说明书。
                                                    </div>
                                                    <br>
                                                    要使用令牌保护的URL页面清单：<br>
                                                    说明：1、输入要使用令牌保护的URL页面；2、可输入多个页面名称，名称加双引号且之间用英文逗号分隔；3、最多可输入256项。<br>
                                                    注意：区分字母大小写、区分全角半角。<br>
                                                    <input class="tag" type="textbox" id="dynamic_token" /><br>
                                                    <br>
                                                    令牌类型：<br>
                                                    <input type="radio" id="dynamic_token_type" name="dynamic_token_type" checked="0" />一次性令牌<br>
                                                    说明：令牌一次性有效。<br>
                                                    一次性令牌有效期（单位：分钟）：<br>
                                                    <div style="width:120px">
                                                        <input class="touchspin1" type="textbox" id="dynamic_token_once_at" style="width:100px;" /><br>
                                                    </div>
                                                    <br>
                                                    <input type="radio" id="dynamic_token_type" name="dynamic_token_type" checked="1" />时间令牌<br>
                                                    说明：令牌在一定时间内有效。<br>
                                                    令牌变化周期（单位：分钟）：<br>
                                                    <div style="width:120px">
                                                        <input class="touchspin1" type="textbox" id="dynamic_token_cyc" style="width:100px;" /><br>
                                                    </div>
                                                </li>
                                                <br>
                                                <li class="altr-color">
                                                    <input type="checkbox" id="robot_detect_enable" />人机识别<br>
                                                    说明：识别并阻止三方程序或引擎驱动的访问。<br>
                                                </li>
                                                <br>
                                                <li class="altr-color">
                                                    <input type="checkbox" id="anti_ddos_enable" />防应用层DDOS<br>
                                                    说明：检测并阻止应用层DDOS攻击。<br>
                                                </li>
                                                <br>
                                                <li class="altr-color">
                                                    <input type="checkbox" id="regexp_shield_enable" />正则表达式防护<br>
                                                    说明：又一重防御体系，检测和防护：SQL注入、XSS、COOKIE注入、远程文件包含、本地文件包含、目录遍历等攻击。<br>
                                                </li>
                                                <br>
                                                <li class="altr-color">
                                                    攻击特征匹配：<br>
                                                    说明：当检测到访问信息（URL、POST、Cookie等数据）含有指定规则内容时，视为恶意非法访问，适用于检测SQL注入、XSS等攻击。<br>
                                                    注意：匹配不区分大小写，必须至少存在一个特征字符串。<br>
                                                    <span class="badge badge-warning">提示：请向官方联系，获取匹配规则。</span><br>
                                                    <input class="tag" type="textbox" id="eval_character" /><br>
                                                </li>
                                                <li class="altr-color">
                                                    <input type="checkbox" id="anti_scan_enable" />反扫描<br>
                                                    说明：防扫描器扫描。启用该功能时，会自动使用攻击特征匹配规则、正则表达式防护规则进行防御。请先配置好以上功能内容。<br>
                                                </li>
                                                <br>
                                                
                                                <li class="altr-color">
                                                    <input type="checkbox" id="page_404_enable" />自定义404页面地址：<br>
                                                    <input class="tag" type="textbox" id="page_404" style="width:100%;max-width: 500px;" /><br>
                                                    注：如页面不存在则显示拦截信息。<br>
                                                    <span class="badge badge-warning">提示：获得正版授权后此功能才生效。</span><br>
                                                </li>
                                                <br>

                                                <li class="altr-color">
                                                    <div>404页面特征内容：<br>
                                                        说明：访问到一个不存在的页面时（即404页面），页面中的包含的特征字符串，这个值用于信息统计，内容需正确设置。<br>
                                                        <div class="input-group m-b">
                                                            <span class="input-group-btn">
                                                                <button type="button" class="btn btn-primary"><i class="fa fa-file-excel-o"></i></button>
                                                            </span> 
                                                            <input class="form-control" type="textbox" id="unknown" style="width:300px;" /><br>
                                                        </div>
                                                    </div>
                                                </li>
                                                <br>
                                                <li class="altr-color">
                                                    <input type="checkbox" id="html_source_encode_enable" />网页源码加密<br>
                                                    说明：对网页html源码进行加密。<br>
                                                    <br>
                                                    排除文件（特征）：<br>
                                                    <input class="tag" type="textbox" id="html_source_encode_except" /><br>
                                                    说明：对指定的文件或具备此特征的网页源码不进行加密。<br>
                                                    注意：请使用全小写字母。<br>
                                                </li>
                                                <br>
                                                <li class="altr-color">
                                                    缓存<br>
                                                    说明：将静态资源进行缓存，如图片、视频等。缓存可以加快访问速度。<br>
                                                    也可用于网页防篡改（静态网站文件）。<br>
                                                    提示：非utf8编码网站慎用缓存，容易异常。<br>
                                                    <br>
                                                    <input type="checkbox" id="cache_enable"/>启用缓存<br>
                                                    缓存文件类型（后缀名）：<br>
                                                    <input class="tag" type="textbox" id="cache_file_type" /><br>
                                                    说明：缓存指定后缀名的文件。<br>
                                                    <br>
                                                    <input type="checkbox" id="cache_update_enable"/>缓存更新<br>
                                                    说明：启用后将在每次访问时，异步更新缓存文件，如要实现网页防篡改效果，则缓存好相关文件后，停用此项。<br>
                                                    <br>
                                                    <button class="btn btn-sm btn-primary" onclick="clear_cache();">清空缓存</button>
                                                    <script>
                                                        function clear_cache(){
                                                            if(confirm("确定要清空缓存吗？")){
                                                                var username = document.getElementById("login_username").value;
                                                                var password = document.getElementById("login_password").value;
                                                                if(socket.connected == true){
                                                                    socket.emit('clear_cache',username,password);
                                                                }else{
                                                                    alert("未连接到服务器！")
                                                                }
                                                            }
                                                        }
                                                    </script>
                                                </li>
                                                <br>
                                            </ul>
                    
                                            <span class="badge badge-info">前端WAF</span>
                                            <br>
                                            <ul>
                                                <li class="altr-color">
                                                    <input type="checkbox" id="browser_id_shield_enable" />浏览器指纹防护<br>
                                                    依托于<span id="oem_dsj_name_1"></span>大数据设备指纹技术，自动识别并阻止恶意访问。<br>
                                                    注：此功能会与<span id="oem_dsj_name_2"></span>大数据平台通信。<br>
                                                    <br>
                                                    <input type="checkbox" id="front_waf_auto" />防自动化攻击<br>
                                                    <input type="checkbox" id="front_waf_sql" />防SQL注入<br>
                                                    <input type="checkbox" id="front_waf_xss" />防XSS<br>
                                                    <input type="checkbox" id="front_waf_csrf" />防CSRF<br>
                                                    <input type="checkbox" id="front_waf_spider" />防爬虫<br>
                                                    <input type="checkbox" id="front_waf_iframe" />防Iframe嵌套<br>
                                                    <input type="checkbox" id="front_waf_no_copy" />网页内容防拷贝<br>
                                                    说明：前端WAF是独立工作的子功能，是对Web安全提供又一重安全保护。启用前端WAF后，多数攻击甚至无法到达服务器端，在客户端就已被阻挡。<br>
                                                    <br>
                                                    排除文件（特征）：<br>
                                                    <input class="tag" type="textbox" id="front_waf_except" style="width:100%;max-width: 500px;" /><br>
                                                    说明：对指定的文件或具备此特征的网页不使用前端WAF。<br>
                                                    注意：请使用全小写字母。<br>
                                                </li>
                                            </ul>
                                            <br>

                                            <span class="badge badge-info">URL白名单</span>
                                            <br>
                                            <ul>
                                                <li class="altr-color">
                                                    白名单列表：<br>
                                                    <input class="tag" type="textbox" id="url_white_list" style="width:100%;max-width: 500px;" /><br>
                                                    白名单中的URL，不会被保护。<br>
                                                    无需全路径，请输入白名单Url文件名，或URL路径特征即可。<br>
                                                    注：优先级高于IP黑名单。<br>
                                                </li>
                                            </ul>
                                            <br>

                                            <span class="badge badge-info">IP黑名单</span>
                                            <br>
                                            <ul>
                                                <li class="altr-color">
                                                    IP黑名单列表：<br>
                                                    <input class="tag" type="textbox" id="black_ip_list" style="width:100%;max-width: 500px;" /><br>
                                                    黑名单中的IP，将无法访问被保护网站。<br>
                                                </li>
                                            </ul>
                                            <br>
                    
                                            <span class="badge badge-info">密码</span>
                                            <br>
                                            <ul>
                                                <li class="altr-color">
                                                    <div>密码：<br>
                                                        <i class="fa fa-meh-o"></i>即登录时的密码。<br>
                                                        <div class="input-group m-b">
                                                            <span class="input-group-btn">
                                                                <button type="button" class="btn btn-primary"><i class="fa fa-crosshairs"></i></button>
                                                            </span> 
                                                            <input class="form-control"type="textbox" id="password" style="width:100%;max-width: 200px;" /><br>
                                                        </div>
                                                    </div>  
                                                </li>
                                            </ul>
                                            <br>

                                            <div>
                                                <ul>
                                                    <li>请确认无误后，再更新配置！</li>
                                                </ul>
                                            </div>
                                            <br>
                    
                                            <div>
                                                <ul>
                                                    <li>
                                                        验证码：<input id="inputCode" name="inputCode" placeholder="请输入验证码"></input>
                                                        <span id="checkCode" onclick="createCode()" style="cursor:pointer;color:green;font-weight:bold;"></span>
                                                    </li>
                                                    <li>
                                                        <br>
                                                        <input class="btn btn-primary" type="button" value="更新配置" id="update_config"/><br>
                                                        <br>
                                                    </li>
                                                </ul>
                                            </div>

                                        </div>
                                        <script type="text/javascript">
                                            //标签式输入框初始化
                                            $(function() {
                                                $('#transform_element').tagsInput({
                                                    width: 'auto',
                                                    maxChars: 128,
                                                    onAddTag: function(){
                                                        console.log(this.value.length);
                                                    }
                                                });
                                                $('#js_unprotect').tagsInput({
                                                    width: 'auto',
                                                    maxChars: 128,
                                                    onAddTag: function(){
                                                        console.log(this.value.length);
                                                    }
                                                });
                                                $('#eval_character').tagsInput({
                                                    width: 'auto',
                                                    maxChars: 128,
                                                    onAddTag: function(){
                                                        console.log(this.value.length);
                                                    }
                                                });
                                                $('#black_ip_list').tagsInput({
                                                    width: 'auto',
                                                    maxChars: 128,
                                                    onAddTag: function(){
                                                        console.log(this.value.length);
                                                    }
                                                });
                                                $('#url_white_list').tagsInput({
                                                    width: 'auto',
                                                    maxChars: 128,
                                                    onAddTag: function(){
                                                        console.log(this.value.length);
                                                    }
                                                });
                                                $('#dynamic_token').tagsInput({
                                                    width: 'auto',
                                                    maxChars: 128,
                                                    onAddTag: function(){
                                                        console.log(this.value.length);
                                                    }
                                                });

                                                $('#html_source_encode_except').tagsInput({
                                                    width: 'auto',
                                                    maxChars: 128,
                                                    onAddTag: function(){
                                                        console.log(this.value.length);
                                                    }
                                                });

                                                $('#cache_file_type').tagsInput({
                                                    width: 'auto',
                                                    maxChars: 128,
                                                    onAddTag: function(){
                                                        console.log(this.value.length);
                                                    }
                                                });
                
                                                $('#front_waf_except').tagsInput({
                                                    width: 'auto',
                                                    maxChars: 128,
                                                    onAddTag: function(){
                                                        console.log(this.value.length);
                                                    }
                                                });
                                                
                                            });
                                        </script>
                                    </div>
                                    <div id="div_config_login_tip">
                                        <span class="badge badge-danger">登录后才能使用</span>
                                    </div>
                                </div>
                                
                            </div>
                            <div id="tab-3" class="tab-pane">
                                <div class="panel-body">
                                    
                                    <div id="div_query" style="display: none;">
                                        <div class="col-lg-6">
                                            <div class="ibox float-e-margins">
                                                <div>
                                                    <h5>数据总计</h5>
                                                    
                                                    <div class="widget style1 navy-bg">
                                                        <div class="row">
                                                            <div class="col-xs-4">
                                                                <i class="fa fa-users fa-5x"></i>
                                                            </div>
                                                            <div class="ibox-tools">
                                                                <button class="btn btn-sm btn-primary pull-right m-t-n-xs" onclick="query_all();"><i class="fa fa-refresh"></i> 刷新</button>
                                                            </div>
                                                            <div class="col-xs-8 text-right">
                                                                <span> 正常访问 </span>
                                                                <h2 class="font-bold" id="total_visitor">0</h2>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="flot-chart">
                                                        <ul class="list-group clear-list m-t">
                                                            
                                                            <li class="list-group-item fist-item">
                                                                <span class="pull-right" id="total_sqlinj_or_xss_attack">
                                                                    0
                                                                </span>
                                                                <span class="label label-warning"><i class="fa fa-eyedropper"></i></span> SQL注入和XSS
                                                            </li>
                                                            
                                                            <li class="list-group-item">
                                                                <span class="pull-right" id="total_robot_attack">
                                                                    0
                                                                </span>
                                                                <span class="label label-primary"><i class="fa fa-bug"></i></span> 机器人攻击
                                                            </li>
                                                            <li class="list-group-item">
                                                                <span class="pull-right" id="total_stealing_ling">
                                                                    0
                                                                </span>
                                                                <span class="label label-info"><i class="fa fa-unlink"></i></span> 盗链
                                                            </li>
                                                            <li class="list-group-item">
                                                                <span class="pull-right" id="total_exceeds_authorized_access">
                                                                    0
                                                                </span>
                                                                <span class="label label-info"><i class="fa fa-xing"></i></span> 越权
                                                            </li>
                                                            <li class="list-group-item">
                                                                <span class="pull-right" id="total_regexp_shield">
                                                                    0
                                                                </span>
                                                                <span class="label label-primary"><i class="fa fa-shield"></i></span> 正则表达式
                                                            </li>
                                                            <li class="list-group-item">
                                                                <span class="pull-right" id="total_unknown">
                                                                    0
                                                                </span>
                                                                <span class="label label-danger"><i class="fa fa-bomb"></i></span> 未知攻击
                                                            </li>
                                                        </ul>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        
                                        <div class="col-lg-6">
                                            <div class="ibox float-e-margins">
                                                
                                                <h5>折线图</h5>提示：时间范围选择的不宜太大，否则可能造引起查询时间太长等问题。
                                                <div class="ibox-tools">
                                                    <button class="btn btn-sm btn-primary pull-right m-t-n-xs" onclick="get_zxt();"><i class="fa fa-refresh"></i> 刷新</button>
                                                </div>
                                                <div class="ibox-content">
                                                    <div class="form-group" id="data_3">
                                                        <label class="font-noraml">日期范围选择</label>
                                                        <div class="input-daterange input-group" id="datepicker">
                                                            <input type="text" class="input-sm form-control" id="zxt_start" name="start" value="05/14/2014"/>
                                                            <span class="input-group-addon">到</span>
                                                            <input type="text" class="input-sm form-control" id="zxt_end" name="end" value="05/22/2014" />
                                                        </div>
                                                        <br>
                                                        <div>
                                                            数据类型
                                                            <select id="zxt_type" name="zxt_type">
                                                                <option value="visitor">正常访问</option>
                                                                <option value="sqlinj_or_xss_attack">注入和XSS</option>
                                                                <option value="robot_attack">机器人攻击</option>
                                                                <option value="exceeds_authorized_access">越权</option>
                                                                <option value="stealing_ling">盗链</option>
                                                                <option value="regexp_shield">正则表达式</option>
                                                                <option value="unknown">未知攻击</option>
                                                            </select>
                                                        </div>
                                                    </div>
                                                    <div class="flot-chart">
                                                        <div class="flot-chart-content" id="flot-line-chart"></div>
                                                    </div>
                                                </div>
                                                <script>
                                                    function zxt_date_init(){
                                                        var month = new Date().getMonth()+1;
                                                        if(month.toString().length == 1){
                                                            month = "0" + month;
                                                        }
                                                        var day = new Date().getDate();
                                                        if(day.toString().length == 1){
                                                            day = "0" + day;
                                                        }
                                                        var today = month + "/"+ day +"/" + new Date().getFullYear();
                                                        document.getElementById("zxt_start").value=today;
                                                        document.getElementById("zxt_end").value=today;
                                                    }
                                                    zxt_date_init();

                                                    

                                                    function get_zxt(){
                                                        var domain = document.getElementById("login_username").value;
                                                        var start = document.getElementById("zxt_start").value;
                                                        var end = document.getElementById("zxt_end").value;
                                                        
                                                        var temp_start;
                                                        temp_start=start;
                                                        temp_start=temp_start.split("/");
                                                        start = temp_start[2]+temp_start[0]+temp_start[1];

                                                        var temp_end;
                                                        temp_end = end;
                                                        temp_end=temp_end.split("/");
                                                        end = temp_end[2]+temp_end[0]+temp_end[1];

                                                        start=start + "000000";
                                                        end = end + "240000";

                                                        var days = (temp_end[2] - temp_start[2]) * 365 + (temp_end[0] - temp_start[0]) * 30 + (temp_end[1] - temp_start[1])
                                                        if(days<0){
                                                            alert("选择有误！请重新选择。");
                                                            return;
                                                        }
                                                        if((temp_end[2] - temp_start[2])>=1){
                                                            alert("抱歉，只可查询一个年度内的数据。请重新选择。");
                                                            return;
                                                        }
                                                        
                                                        console.log ("查询",days,"天的数据。",start,end);

                                                        var zxt_type = document.getElementById("zxt_type").value;
                                                        socket.emit('show_trend', {domain:document.getElementById("login_username").value, type:zxt_type, start: start, end:end });
                                                    }
                                                </script>
                                            </div>
                                        </div>
                                        
                                        <div class="col-lg-12">
                                        </div>
                                        
                                        <div class="col-lg-6">
                                            <div class="ibox float-e-margins">
                                                <div class="ibox-title">
                                                    <h5>饼图</h5>
                                                    <div class="ibox-tools">
                                                        <button class="btn btn-sm btn-primary pull-right m-t-n-xs" onclick="get_bxt();"><i class="fa fa-refresh"></i> 刷新</button>
                                                    </div>
                                                </div>
                                                <div class="ibox-content">
                                                    <div class="form-group" id="data_3">
                                                        <label class="font-noraml">日期范围选择</label>
                                                        <div class="input-daterange input-group" id="datepicker">
                                                            <input type="text" class="input-sm form-control" id="bxt_start" name="start" value="05/14/2014"/>
                                                            <span class="input-group-addon">到</span>
                                                            <input type="text" class="input-sm form-control" id="bxt_end" name="end" value="05/22/2014" />
                                                        </div>
                                                    </div>
                                                    <div class="flot-chart">
                                                        <div class="flot-chart-pie-content" id="flot-pie-chart"></div>
                                                    </div>
                                                    <script>
                                                        function bxt_date_init(){
                                                            var month = new Date().getMonth()+1;
                                                            if(month.toString().length == 1){
                                                                month = "0" + month;
                                                            }
                                                            var day = new Date().getDate();
                                                            if(day.toString().length == 1){
                                                                day = "0" + day;
                                                            }
                                                            var today = month + "/"+ day +"/" + new Date().getFullYear();
                                                            document.getElementById("bxt_start").value=today;
                                                            document.getElementById("bxt_end").value=today;
                                                        }
                                                        bxt_date_init();
        
                                                        function get_bxt(){

                                                            //如果未登录，返回
                                                            if(document.getElementById("div_query_login_tip").style.display != "none") {
                                                                return;
                                                            }
                                                            
                                                            var domain = document.getElementById("login_username").value;
                                                            var start = document.getElementById("bxt_start").value;
                                                            var end = document.getElementById("bxt_end").value;
                                                            
                                                            var temp_start;
                                                            temp_start=start;
                                                            temp_start=temp_start.split("/");
                                                            start = temp_start[2]+temp_start[0]+temp_start[1];
        
                                                            var temp_end;
                                                            temp_end = end;
                                                            temp_end=temp_end.split("/");
                                                            end = temp_end[2]+temp_end[0]+temp_end[1];
        
                                                            start=start + "000000";
                                                            end = end + "240000";
        
                                                            var days = (temp_end[2] - temp_start[2]) * 365 + (temp_end[0] - temp_start[0]) * 30 + (temp_end[1] - temp_start[1])
                                                            if(days<0){
                                                                alert("选择有误！请重新选择。");
                                                                return;
                                                            }
                                                            if((temp_end[2] - temp_start[2])>=1){
                                                                alert("抱歉，只可查询一个年度内的数据。请重新选择。");
                                                                return;
                                                            }
                                                            
                                                            console.log ("查询",days,"天的数据。",start,end);

                                                            socket.emit('show_data', {domain:document.getElementById("login_username").value, start: start, end:end });

                                                            //数据更新标识，每次查询置为0，各数据查询返回为置为1
                                                            visitor_refresh = 0;
                                                            sqlinj_or_xss_attack_refresh = 0;
                                                            robot_attack_refresh = 0;
                                                            exceeds_authorized_access_refresh = 0;
                                                            stealing_ling_refresh = 0;
                                                            unknown_refresh = 0;

                                                            document.getElementById("zzt_start").value = document.getElementById("bxt_start").value;
                                                            document.getElementById("zzt_end").value = document.getElementById("bxt_end").value;
                                                        }
                                                    </script>
                                                </div>
                                            </div>
                                        </div>
                                        
                                        <div class="col-lg-6">
                                            <div class="ibox float-e-margins">
                                                <div class="ibox-title">
                                                    <h5>柱状图</h5>
                                                    <div class="ibox-tools">
                                                        <button class="btn btn-sm btn-primary pull-right m-t-n-xs" onclick="get_zzt();"><i class="fa fa-refresh"></i> 刷新</button>
                                                    </div>
                                                </div>
                                                <div class="ibox-content">
                                                        <div class="form-group" id="data_3">
                                                            <label class="font-noraml">日期范围选择</label>
                                                            <div class="input-daterange input-group" id="datepicker">
                                                                <input type="text" class="input-sm form-control" id="zzt_start" name="start" value="05/14/2014"/>
                                                                <span class="input-group-addon">到</span>
                                                                <input type="text" class="input-sm form-control" id="zzt_end" name="end" value="05/22/2014" />
                                                            </div>
                                                        </div>
                                                        <div class="flot-chart">
                                                            <div class="flot-chart-content" id="flot-bar-chart"></div>
                                                        </div>
                                                        <script>
                                                            function zzt_date_init(){
                                                                var month = new Date().getMonth()+1;
                                                                if(month.toString().length == 1){
                                                                    month = "0" + month;
                                                                }
                                                                var day = new Date().getDate();
                                                                if(day.toString().length == 1){
                                                                    day = "0" + day;
                                                                }
                                                                var today = month + "/"+ day +"/" + new Date().getFullYear();
                                                                document.getElementById("zzt_start").value=today;
                                                                document.getElementById("zzt_end").value=today;
                                                            }
                                                            zzt_date_init();
            
                                                            function get_zzt(){

                                                                //如果未登录，返回
                                                                if(document.getElementById("div_query_login_tip").style.display != "none") {
                                                                    return;
                                                                }
                                                                
                                                                var domain = document.getElementById("login_username").value;
                                                                var start = document.getElementById("zzt_start").value;
                                                                var end = document.getElementById("zzt_end").value;
                                                                
                                                                var temp_start;
                                                                temp_start=start;
                                                                temp_start=temp_start.split("/");
                                                                start = temp_start[2]+temp_start[0]+temp_start[1];
            
                                                                var temp_end;
                                                                temp_end = end;
                                                                temp_end=temp_end.split("/");
                                                                end = temp_end[2]+temp_end[0]+temp_end[1];
            
                                                                start=start + "000000";
                                                                end = end + "240000";
            
                                                                var days = (temp_end[2] - temp_start[2]) * 365 + (temp_end[0] - temp_start[0]) * 30 + (temp_end[1] - temp_start[1])
                                                                if(days<0){
                                                                    alert("选择有误！请重新选择。");
                                                                    return;
                                                                }
                                                                if((temp_end[2] - temp_start[2])>=1){
                                                                    alert("抱歉，只可查询一个年度内的数据。请重新选择。");
                                                                    return;
                                                                }
                                                                
                                                                console.log ("查询",days,"天的数据。",start,end);
        
                                                                socket.emit('show_data', {domain:document.getElementById("login_username").value, start: start, end:end });
        
                                                                //数据更新标识，每次查询置为0，各数据查询返回为置为1
                                                                visitor_refresh = 0;
                                                                sqlinj_or_xss_attack_refresh = 0;
                                                                robot_attack_refresh = 0;
                                                                exceeds_authorized_access_refresh = 0;
                                                                stealing_ling_refresh = 0;
                                                                unknown_refresh = 0;

                                                                document.getElementById("bxt_start").value = document.getElementById("zzt_start").value;
	                                                            document.getElementById("bxt_end").value = document.getElementById("zzt_end").value;
                                                            }
                                                        </script>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-lg-12">
                                            <div class="ibox float-e-margins">
                                                <div class="ibox-title">
                                                    <h5>数据详情 
                                                        <span class="badge badge-info" id="origins_query_info">0/0</span>
                                                        <span class="badge badge-info" id="origins_query_count">0</span>
                                                    </h5>
                                                </div>
                                                <div class="ibox-content">
                                                    <div class="row">
                                                        <div class="col-sm-3 m-b-xs">
                                                            <div class="btn-group">
                                                                <button type="button" class="btn btn-white" id="origens_previous" onclick="origens_query('pre','','')"><i class="fa fa-chevron-left"></i></button>
                                                                <button type="button" class="btn btn-white" id="origens_next" onclick="origens_query('nex','','')"><i class="fa fa-chevron-right"></i> </button>
                                                            </div>
                                                            &nbsp;
                                                            <button type="button" class="btn btn-primary" onclick="origens_query(0,'','');"><i class="fa fa-refresh"></i> 刷新</button>
                                                        </div>
                                                        <div class="col-sm-6 m-b-xs">
                                                            <div class="form-group" id="data_3">
                                                                <label class="font-noraml">日期范围选择</label>
                                                                <div class="input-daterange input-group" id="datepicker">
                                                                    <input type="text" class="input-sm form-control" id="gjsj_start" name="gjsj_start" value="05/14/2014"/>
                                                                    <span class="input-group-addon">到</span>
                                                                    <input type="text" class="input-sm form-control" id="gjsj_end" name="gjsj_end" value="05/22/2014" />
                                                                </div>
                                                                <script>
                                                                    function gjsj_date_init(){
                                                                        var month = new Date().getMonth()+1;
                                                                        if(month.toString().length == 1){
                                                                            month = "0" + month;
                                                                        }
                                                                        var day = new Date().getDate();
                                                                        if(day.toString().length == 1){
                                                                            day = "0" + day;
                                                                        }
                                                                        var today = month + "/"+ day +"/" + new Date().getFullYear();
                                                                        document.getElementById("gjsj_start").value=today;
                                                                        document.getElementById("gjsj_end").value=today;
                                                                    }
                                                                    gjsj_date_init();
                                                                </script>
                                                            </div>
                                                        </div>
                                                        <div class="col-sm-3">
                                                            <div class="input-group">
                                                                <input type="text" placeholder="输入搜索内容" class="input-sm form-control" style="height:40px;" id="search_data"> 
                                                                <span class="input-group-btn">
                                                                    <button data-toggle="dropdown" class="btn btn-primary dropdown-toggle" style="height:40px;">搜索 <span class="caret"></span></button>
                                                                    <ul class="dropdown-menu"  style="left: -20px;">
                                                                        <li><a onclick="origins_query_page = 1;origins_query_page_max =1;if(document.getElementById('search_data').value==''){alert('搜索内容不能为空。');return;};origens_query(0,'ip',document.getElementById('search_data').value);">IP</a></li>
                                                                        <li><a onclick="origins_query_page = 1;origins_query_page_max =1;if(document.getElementById('search_data').value==''){alert('搜索内容不能为空。');return;};origens_query(0,'agent',document.getElementById('search_data').value);">Agent</a></li>
                                                                        <li><a onclick="origins_query_page = 1;origins_query_page_max =1;if(document.getElementById('search_data').value==''){alert('搜索内容不能为空。');return;};origens_query(0,'lon_lat',document.getElementById('search_data').value);">经纬度</a></li>
                                                                        <li><a onclick="origins_query_page = 1;origins_query_page_max =1;if(document.getElementById('search_data').value==''){alert('搜索内容不能为空。');return;};origens_query(0,'type',document.getElementById('search_data').value);">类型</a></li>
                                                                    </ul>
                                                                </span>
                                                            </div>
                                                            <div class="btn-group">
                                                                <button type="button" class="btn btn-white" id="search_origens_previous" onclick="origens_query('pre',search_flag,document.getElementById('search_data').value)"><i class="fa fa-chevron-left"></i></button>
                                                                <button type="button" class="btn btn-white" id="search_origens_next" onclick="origens_query('nex',search_flag,document.getElementById('search_data').value)"><i class="fa fa-chevron-right"></i> </button>
                                                            </div>
                                                            <span class="badge badge-warning"><i class="fa fa-arrow-circle-o-left"></i> 用于控制搜索翻页</span>
                                                        </div>
                                                    </div>
                                                    <div class="table-responsive">
                                                        <table class="table table-striped">
                                                            <thead>
                                                            <tr>
                                                                <th>NO.</th>
                                                                <th><i class="fa fa-clock-o"></i> 时间</th>
                                                                <th><i class="fa fa-eye"></i> IP</th>
                                                                <th><i class="fa fa-info-circle"></i> Agent</th>
                                                                <th><i class="fa fa-globe"></i> 经纬度</th>
                                                                <th><i class="fa fa-user"></i> 类型</th>
                                                                <th>URL</th>
                                                            </tr>
                                                            </thead>
                                                            <tbody>
                                                                <tr>
                                                                    <td><span id="NO_0">0-1</span></td>
                                                                    <td><span id="time_0">2019-01-01-01:00:20</span></td>
                                                                    <td><span id="ip_0">127.0.0.1</span></td>
                                                                    <td><span id="agent_0">user agent</span></td>
                                                                    <td><span id="jwd_0">0,0</span></td>
                                                                    <td><i class="fa fa-user"></i> <span id="attack_type_0">visitor</span></td>
                                                                    <td><i class="fa fa-level-up"></i> <span id="url_0">/index.html</span> </td>
                                                                </tr>
                                                                
                                                                <tr>
                                                                    <td><span id="NO_1">0-1</span></td>
                                                                    <td><span id="time_1">2019-01-01-01:00:20</span></td>
                                                                    <td><span id="ip_1">127.0.0.1</span></td>
                                                                    <td><span id="agent_1">user agent</span></td>
                                                                    <td><span id="jwd_1">0,0</span></td>
                                                                    <td><i class="fa fa-user"></i> <span id="attack_type_1">visitor</span></td>
                                                                    <td><i class="fa fa-level-up"></i> <span id="url_1">/index.html</span> </td>
                                                                </tr>

                                                                <tr>
                                                                    <td><span id="NO_2">0-1</span></td>
                                                                    <td><span id="time_2">2019-01-01-01:00:20</span></td>
                                                                    <td><span id="ip_2">127.0.0.1</span></td>
                                                                    <td><span id="agent_2">user agent</span></td>
                                                                    <td><span id="jwd_2">0,0</span></td>
                                                                    <td><i class="fa fa-user"></i> <span id="attack_type_2">visitor</span></td>
                                                                    <td><i class="fa fa-level-up"></i> <span id="url_2">/index.html</span> </td>
                                                                </tr>

                                                                <tr>
                                                                    <td><span id="NO_3">0-1</span></td>
                                                                    <td><span id="time_3">2019-01-01-01:00:20</span></td>
                                                                    <td><span id="ip_3">127.0.0.1</span></td>
                                                                    <td><span id="agent_3">user agent</span></td>
                                                                    <td><span id="jwd_3">0,0</span></td>
                                                                    <td><i class="fa fa-user"></i> <span id="attack_type_3">visitor</span></td>
                                                                    <td><i class="fa fa-level-up"></i> <span id="url_3">/index.html</span> </td>
                                                                </tr>

                                                                <tr>
                                                                    <td><span id="NO_4">0-1</span></td>
                                                                    <td><span id="time_4">2019-01-01-01:00:20</span></td>
                                                                    <td><span id="ip_4">127.0.0.1</span></td>
                                                                    <td><span id="agent_4">user agent</span></td>
                                                                    <td><span id="jwd_4">0,0</span></td>
                                                                    <td><i class="fa fa-user"></i> <span id="attack_type_4">visitor</span></td>
                                                                    <td><i class="fa fa-level-up"></i> <span id="url_4">/index.html</span> </td>
                                                                </tr>

                                                                <tr>
                                                                    <td><span id="NO_5">0-1</span></td>
                                                                    <td><span id="time_5">2019-01-01-01:00:20</span></td>
                                                                    <td><span id="ip_5">127.0.0.1</span></td>
                                                                    <td><span id="agent_5">user agent</span></td>
                                                                    <td><span id="jwd_5">0,0</span></td>
                                                                    <td><i class="fa fa-user"></i> <span id="attack_type_5">visitor</span></td>
                                                                    <td><i class="fa fa-level-up"></i> <span id="url_5">/index.html</span> </td>
                                                                </tr>

                                                                <tr>
                                                                    <td><span id="NO_6">0-1</span></td>
                                                                    <td><span id="time_6">2019-01-01-01:00:20</span></td>
                                                                    <td><span id="ip_6">127.0.0.1</span></td>
                                                                    <td><span id="agent_6">user agent</span></td>
                                                                    <td><span id="jwd_6">0,0</span></td>
                                                                    <td><i class="fa fa-user"></i> <span id="attack_type_6">visitor</span></td>
                                                                    <td><i class="fa fa-level-up"></i> <span id="url_6">/index.html</span> </td>
                                                                </tr>

                                                                <tr>
                                                                    <td><span id="NO_7">0-1</span></td>
                                                                    <td><span id="time_7">2019-01-01-01:00:20</span></td>
                                                                    <td><span id="ip_7">127.0.0.1</span></td>
                                                                    <td><span id="agent_7">user agent</span></td>
                                                                    <td><span id="jwd_7">0,0</span></td>
                                                                    <td><i class="fa fa-user"></i> <span id="attack_type_7">visitor</span></td>
                                                                    <td><i class="fa fa-level-up"></i> <span id="url_7">/index.html</span> </td>
                                                                </tr>

                                                                <tr>
                                                                    <td><span id="NO_8">0-1</span></td>
                                                                    <td><span id="time_8">2019-01-01-01:00:20</span></td>
                                                                    <td><span id="ip_8">127.0.0.1</span></td>
                                                                    <td><span id="agent_8">user agent</span></td>
                                                                    <td><span id="jwd_8">0,0</span></td>
                                                                    <td><i class="fa fa-user"></i> <span id="attack_type_8">visitor</span></td>
                                                                    <td><i class="fa fa-level-up"></i> <span id="url_8">/index.html</span> </td>
                                                                </tr>

                                                                <tr>
                                                                    <td><span id="NO_9">0-1</span></td>
                                                                    <td><span id="time_9">2019-01-01-01:00:20</span></td>
                                                                    <td><span id="ip_9">127.0.0.1</span></td>
                                                                    <td><span id="agent_9">user agent</span></td>
                                                                    <td><span id="jwd_9">0,0</span></td>
                                                                    <td><i class="fa fa-user"></i> <span id="attack_type_9">visitor</span></td>
                                                                    <td><i class="fa fa-level-up"></i> <span id="url_9">/index.html</span> </td>
                                                                </tr>
                                                            </tbody>
                                                        </table>
                                                    </div>
                        
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    
                                    <div id="div_query_login_tip">
                                        <span class="badge badge-danger">登录后才能使用</span>
                                    </div>
                                </div>
                            </div>

                            <div id="tab-4" class="tab-pane">
                                <div class="panel-body">
                                    <div id="div_sa" style="display: none">
                                        <button class="btn btn-sm btn-primary" type="submit" onclick='window.open("sa.html#d="+document.getElementById("login_username").value, "_blank", "scrollbars=yes,resizable=1,modal=false,alwaysRaised=yes");'>实时态势感知</button>
                                    </div>
                                    <div id="div_sa_login_tip">
                                        <span class="badge badge-danger">登录后才能使用</span>
                                    </div>
                                </div>
                            </div>
                            
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>

    
    <!--websocket-->
    <!--<script src="lib/socket.io.js"></script>-->
    <script src="/socket.io/socket.io.js"></script>

    <!--服务器ip配置-->
    <script src="config.js"></script>
    <!--OEM-->
    <script src="oem.js"></script>
    <script>
        /* OEM */
        function index_oem(){
            document.title = oem_title;
            document.getElementById("p_title").innerHTML = oem_title;
            document.getElementById("oem_homepage").innerHTML = oem_name + "官网";
            document.getElementById("oem_homepage_url").href = oem_url;
            document.getElementById("oem_dsj_name_1").value = oem_name;
            document.getElementById("oem_dsj_name_2").value = oem_name;
        }
        index_oem();
    </script>
    <!--功能源码-->
    <script src="source.js"></script>
    <!-- 验证码 -->
    <script src="src/verify.js"></script>
    <script>
        //获取url参数
        function GetQueryString(name)
        {
            var reg = new RegExp("(#|&)"+ name +"=([^&]*)(&|$)");
            var r = window.location.toString().match(reg);
            
            if(r!=null)return  unescape(r[2]); return null;
        }

        var url_username = GetQueryString("username");
        var url_password = GetQueryString("password");
        
        //如果url中传入了参数，则自动登录
        if((url_username != null)&&(url_password != null)){
            document.getElementById("login_username").value = url_username;
            document.getElementById("login_password").value = url_password;
            
            login();
        }
    </script>

    <script>
        //验证码
        var verifyCode_login = new Verify_login("verify_login");
        function verify_login(){
            var res = verifyCode_login.validate(document.getElementById("code_login_input").value);
            if(res){
                login();
            }else{
                document.getElementById("code_login_input").value = "";
                document.getElementById("verifyCanvas1").click();
                swal({
                    title: "",
                    text: "验证码错误。"
                });	
            }
        }
        var verifyCode_register = new Verify_register("verify_register");
        function verify_register(){
            var res = verifyCode_register.validate(document.getElementById("code_register_input").value);
            if(res){
                register();
            }else{
                document.getElementById("code_register_input").value = "";
                document.getElementById("verifyCanvas2").click();
                swal({
                    title: "",
                    text: "验证码错误。"
                });	
            }
        }
        //按下回车时登录，按键信息对象以函数参数的形式传递进来了，就是那个e
        /*
        document.onkeyup = function (e) {
            //取出按键信息中的按键代码(大部分浏览器通过keyCode属性获取按键代码，但少部分浏览器使用的却是charCode)
            var code = e.charCode || e.keyCode;  
            if (code == 13) {
                verify_login();
            }
        }
        */

        //单选和筛选框初始化
        $(document).ready(function(){
            $('.i-checks').iCheck({
                checkboxClass: 'icheckbox_square-green',
                radioClass: 'iradio_square-green',
            });
        });

        //带加减号文本框初始化
        $(".touchspin1").TouchSpin({
            buttondown_class: 'btn btn-white',
            buttonup_class: 'btn btn-white',
            min: 1,
            max: 65535,
        });
    </script> 

    <script>
        $('#data_1 .input-daterange').datepicker({
            keyboardNavigation: false,
            forceParse: false,
            autoclose: true
        });
        $('#data_2 .input-daterange').datepicker({
            keyboardNavigation: false,
            forceParse: false,
            autoclose: true
        });
        $('#data_3 .input-daterange').datepicker({
            keyboardNavigation: false,
            forceParse: false,
            autoclose: true
        });

        window.onresize = function(){
            
        }

        // JS正则表达式获取地址栏url参数
        function getUrlParam(name) {
            
            //构造一个含有目标参数的正则表达式对象
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); 

            //匹配目标参数
            var r = window.location.search.substr(1).match(reg); 
            if (r != null) return unescape(r[2]);

            //返回参数值
            return null; 
        }
        var url_username = getUrlParam("username");
        var url_password = getUrlParam("password")
        //alert(url_password);

    </script>

</body>

</html>
